

#ifndef _DRV_USART_DEFINITIONS_H
#define _DRV_USART_DEFINITIONS_H
#include "gd32f4xx_usart.h"
#include "driver/driver_common.h"

#ifdef __cplusplus  // Provide C++ Compatibility

    extern "C" {

#endif

#define DRV_USART_INDEX_0             0
#define DRV_USART_INDEX_1             1
#define DRV_USART_INDEX_2             2
#define DRV_USART_INDEX_3             3
#define DRV_USART_INDEX_4             4
#define DRV_USART_INDEX_5             5

typedef enum
{
    USART_ID_0 = USART0,
    USART_ID_1 = USART1,
    USART_ID_2 = USART2,
    USART_ID_3 = UART3,
    USART_ID_4 = UART4,
    USART_ID_5 = USART5,
    USART_NUMBER_OF_MODULES = 6
} USART_MODULE_ID;

#define DRV_USART_INSTANCES_NUMBER 1

#define DRV_USART_COUNT   USART_NUMBER_OF_MODULES

typedef struct
{
    /* The module index associated with the object*/
    USART_MODULE_ID moduleId;

    /* Flag to indicate this object is in use  */
    bool inUse;

} DRV_USART_OBJ;

typedef struct usart_cfg_tag
{
    uint32_t usartID;
    uint32_t baudval;
    uint32_t wlen;
    uint32_t stblen;
    uint32_t rxconfig;
    uint32_t txconfig;
} usart_cfg_t;


#ifdef __cplusplus
}
#endif

#endif // #ifndef _DRV_USART_DEFINITIONS_H
/*******************************************************************************
 End of File
*/

